All Functions of Week 9

expression

{base}

Used in plots to add symbols to axes

t.test

{stats}

Performs one and two sample t-tests on vectors of data.

sd

{stats}

Get standard deviation of a vector

geom_line

{GGPLOT2}

Generates a line

read.csv

{utils}

Read a csv file to data frame. Specify stringsAsFactors = FALSE to keep all string columns as characters

set.seed

{base}

Initialise a pseudorandom number generator.

stat_ecdf

{GGPLOT2}

Compute empirical cumulative distribution

scale_y_continuous

{GGPLOT2}

Customise continuous y axis

sqrt

{stats}

Square root

geom_hline

{GGPLOT2}

Add a horizontal line in GGPLOT2

scale_x_continuous

{GGPLOT2}

Customise continuous x axis

with

{base}

evaluate expression in the context of a data frame

tibble

{tibble}

A modern data frame from the tidyverse

c

{base}

Combine values/vectors into a vector

element_line

{GGPLOT2}

Customise line appearance

element_text

{GGPLOT2}

Customise text in GGPLOT2

rnorm

{base}

Generate random numbers from a normal distribution

mutate

{dplyr}

Modify/create a column in a data frame

complete.cases

{stats}

Find Complete Cases

prop.test

{stats}

Test of Equal or Given Proportions

rm

{base}

Remove objects

setwd

{base}

Set Working Directory

ls

{base}

Return a vector of character strings giving the names of the objects in the specified environment

geom_histogram

{GGPLOT2}

Generates a histogram

cut

{base}

Convert Numeric to Factor

ggplot

{GGPLOT2}

Create a ggplot graph

aes

{GGPLOT2}

Construct aesthetic mapping of a ggplot graph

ifelse

{base}

Return a or b depending on the value of test

labs

{GGPLOT2}

Customise labels in GGPLOT2

theme

{GGPLOT2}

Set theme for GGPLOT2

library

{base}

Load an R package

table

{base}

Obtain frequency table of a variable/cross-tabulation of two variables

median

{stats}

Get median of a vector

element_blank

{GGPLOT2}

This theme element draws nothing, and assigns no space

mean

{base}

Get mean of a vector

max

{base}

Get maximum of a vector

ggsave

{ggplot2}

Saves the last ggplot or a specified ggplot object to a file

data.frame

{base}

Create a data.frame from vectors

The end!